<h1>Listing rooms</h1>

<% link_to new_room_path, :class => 'ui-state-default ui-corner-all dialog_link' do %>
	<span class="ui-icon ui-icon-plus"></span>New room
<% end %>

<table>
  <tr class="ui-state-default">
    <th>Code</th>
    <th>Stock</th>
    <th>Capacity</th>
    <th>Company</th>
	<th></th>
	<th></th>
  </tr>

<% @rooms.each do |room| %>
  <tr>
    <td><%=h room.code  %></td>
    <td><%=h room.stock %></td>
    <td><%=h room.capacity %></td>
    <td><% if room.company != nil %><%=h room.company.name %><% end %></td>
    <td>
    	<% link_to room, :class => "ui-state-default ui-corner-all dialog_link" do %>
			<span class="ui-icon ui-icon-search"></span>View
		<% end %>
    </td>
	<td>
		<% link_to room, :confirm => 'Are you sure ?', :method => :delete, :class => "ui-state-error ui-corner-all dialog_link ui-state-hover" do %>
			<span class="ui-icon ui-icon-close"></span>Destroy
		<% end %>
	</td>
  </tr>
<% end %>
</table>
